package com.模板方法模式.流程模板;

import java.util.Scanner;

/**
 * @author: wh(1835734390 @ qq.com)
 * @date: 2023/7/7 10:32
 * @description:
 * @version:
 */
public class Circle extends AbsShape{
    //半径
    double r;
    @Override
    public void input() {
        System.out.println("请输入半径：");
        Scanner scanner = new Scanner(System.in);
        r = scanner.nextDouble();
    }

    @Override
    public double getArea() {
        double s = Math.PI*r*r;
        return s;
    }
}
